package cn.neusoft.yuejian307.tencent;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.tencent.tauth.IUiListener;
import com.tencent.tauth.UiError;

import cn.neusoft.yuejian307.activity.MainActivity;


/**
 * Created by 木子也 on 2017/10/9.
 */

public class LoginUiListener implements IUiListener {
    private AppCompatActivity activity;
    public LoginUiListener(AppCompatActivity activity){
        this.activity = activity;
    }


    public void onComplete(Object response) {
        Intent intent = new Intent(activity, MainActivity.class);
        activity.startActivity(intent);
        activity.finish();

    }


    @Override
    public void onError(UiError uiError) {
        Toast.makeText(activity.getApplicationContext(), "onError", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onCancel() {
        Toast.makeText(activity.getApplicationContext(), "onCancel", Toast.LENGTH_SHORT).show();
    }

}